<?php
	class anxuan_tag extends HDPHP{
		public $tag = array(
			'swfupload_overlay' => array('block' => 0), //swf上传组件 overlay组件
        	'my_jqueryui' => array('block' => 0),
        	'hd_jqueryui' => array('block' => 0),
		

		);

    //jQueryUI
    public function _hd_jqueryui($attr, $content) {
        $str = '';
        $str .= "<script language = 'javascript'>window.jQuery || document.write('<script type=\"text/javascript\" src=\"__HDPHP_PLUGIN__/jquery-1.8.2.min.js\"><\/script>');</script>";
        $str .= '<?php  $hd_calendar_id = isset($hd_calendar_id) ? ++$hd_calendar_id : 0;if ($hd_calendar_id == 0) :?>';
        $str .= "<script type='text/javascript' src='" . __ROOT__ . "/data/js/jqueryui/jquery-ui-1.8.21.custom.min.js'></script>
                 <link  rel='stylesheet' type='text/css' href='" . __ROOT__ . "/data/js/jqueryui/jquery-ui-1.8.21.custom.css'/>";
        $str .= '<?php  endif;?>';
        return $str;
    }
		//jqueryui
    public function _my_jqueryui($attr, $content) {
        $str = '';
        // $file = __ROOT__ . 'data/js/jqueryui/jquery-1.7.1.js';//js文件1
        // $str.= "<script type='text/javascript' src='$file'></script>";

        $file = __ROOT__ . '/data/js/jqueryui/jquery.ui.core.js';//js文件2
        $str.= "<script type='text/javascript' src='$file'></script>";
		
		$file = __ROOT__ . '/data/js/jqueryui/jquery.ui.widget.js';//js文件4
        $str.= "<script type='text/javascript' src='$file'></script>";
        
        $file = __ROOT__ . '/data/js/jqueryui/jquery.ui.tabs.js';//js文件3
        $str.= "<script type='text/javascript' src='$file'></script>";

        

        $file = __ROOT__ . '/data/js/jqueryui/jquery.ui.widget.js';//js文件4
        $str.= "<script type='text/javascript' src='$file'></script>";

        $file = __ROOT__ . '/data/js/jqueryui/jquery.ui.datepicker.js';//js文件4
        $str.= "<script type='text/javascript' src='$file'></script>";


        $file = __ROOT__ . '/data/js/jqueryui/base/jquery.ui.all.css';//css文件
        $str.="<link rel='stylesheet' type='text/css' href='$file'/>";

        return $str;
    }
		//overlay上传组件
		function _swfupload_overlay($attr,$content){
			static $_hd_uploadify_js = false; //js文件只加载一次


			$str='';
			//载入js文件
			if(!$_hd_uploadify_js){
				$_hd_uploadify_js = true; //只加载一次
				$str.='
<link href="'.__HDPHP_PLUGIN__.'/swfupload/css/default.css" rel="stylesheet" type="text/css" />
<style type="text/css">
	.swfupload {
		position: absolute;
		z-index: 1;
	}
</style>

<script type="text/javascript" src="'.__HDPHP_PLUGIN__.'/swfupload/public/swfupload.js"></script>
<script type="text/javascript" src="'.__HDPHP_PLUGIN__.'/swfupload/overlay/js/swfupload.swfobject.js"></script>
<script type="text/javascript" src="'.__HDPHP_PLUGIN__.'/swfupload/overlay/js/swfupload.queue.js"></script>
<script type="text/javascript" src="'.__HDPHP_PLUGIN__.'/swfupload/overlay/js/fileprogress.js"></script>
<script type="text/javascript" src="'.__HDPHP_PLUGIN__.'/swfupload/overlay/js/handlers.js"></script>';
			}

//
$str.='<script type="text/javascript">
var swfu;

SWFUpload.onload = function () {
	var settings = {
		flash_url : "'.__HDPHP_PLUGIN__.'/swfupload/public/swfupload.swf",
		upload_url: "'.__HDPHP_PLUGIN__.'/swfupload/overlay/upload.php",
		file_size_limit : "100 MB",
		file_types : "*.*",
		file_types_description : "All Files",
		file_upload_limit : 100,
		file_queue_limit : 0,
		custom_settings : {
			progressTarget : "fsUploadProgress",
			cancelButtonId : "btnCancel"
		},
		debug: false,

		// Button Settings
		button_placeholder_id : "spanButtonPlaceholder",
		button_width: 61,
		button_height: 22,
		button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
		button_cursor: SWFUpload.CURSOR.HAND,

		// The event handler functions are defined in handlers.js
		swfupload_loaded_handler : swfUploadLoaded,
		file_queued_handler : fileQueued,
		file_queue_error_handler : fileQueueError,
		file_dialog_complete_handler : fileDialogComplete,
		upload_start_handler : uploadStart,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,
		upload_complete_handler : uploadComplete,
		queue_complete_handler : queueComplete,	// Queue plugin event
		
		// SWFObject settings
		minimum_flash_version : "9.0.28",
		swfupload_pre_load_handler : swfUploadPreLoad,
		swfupload_load_failed_handler : swfUploadLoadFailed
	};

	swfu = new SWFUpload(settings);
}

</script>
			';

//插入实现的代码
		$str.='
			<form id="form1" action="'.__METH__.'" method="post" enctype="multipart/form-data">
		<p> This page demonstrates placing transparent button over an existing button using a little bit of simple CSS: </p>

		<div id="divSWFUploadUI">
			<div class="fieldset flash" id="fsUploadProgress">
			<span class="legend">Upload Queue</span>
			</div>
			<p id="divStatus">0 Files Uploaded</p>
			<p>
				<span id="spanButtonPlaceholder"></span>
				<input id="btnUpload" type="button" value="Select Files" style="width: 61px; height: 22px; font-size: 8pt;" />
				<input id="btnCancel" type="button" value="Cancel All Uploads" disabled="disabled" style="margin-left: 2px; height: 22px; font-size: 8pt;" />
			</p>
			<br style="clear: both;" />
		</div>
		<noscript style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px;">
			We\'re sorry.  SWFUpload could not load.  You must have JavaScript enabled to enjoy SWFUpload.
		</noscript>
		<div id="divLoadingContent" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
			SWFUpload is loading. Please wait a moment...
		</div>
		<div id="divLongLoading" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
			SWFUpload is taking a long time to load or the load has failed.  Please make sure that the Flash Plugin is enabled and that a working version of the Adobe Flash Player is installed.
		</div>
		<div id="divAlternateContent" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
			We\'re sorry.  SWFUpload could not load.  You may need to install or upgrade Flash Player.
		
		</div>
	</form>
		';
return $str;

		}
	}
?>